package edu.ctbu.ctbujsj.webapi;

import edu.ctbu.ctbujsj.domain.Area;
import edu.ctbu.ctbujsj.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class AreaRestController {

    @Autowired
    private AreaService areaService;



    @RequestMapping("/webapi/area/findbyparentid")
     public List<Area> findByParentId(long parentid){
         List<Area> myList= areaService.findByParentId(parentid);
         return myList;
     }

}
